import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import math

fig, ax = plt.subplots(1, 1)

lambdaUse = 2
loc = 0
scale = 1.0 / lambdaUse


# ppf:累积分布函数的反函数。q=0.01时，ppf就是p(X<x)=0.01时的x值。
# x = np.linspace(stats.expon.ppf(0.01, loc, scale), stats.expon.ppf(0.99, loc, scale), 100)

x=np.linspace(0,2,100)
print(x)
plt.plot(x, stats.expon.pdf(x, loc, scale))

plt.show()